﻿Namespace Assets

    Public Class VisibilityConverter
        Implements IValueConverter

        Public Function Convert(value As Object _
                              , targetType As Type _
                              , parameter As Object _
                              , culture As Globalization.CultureInfo) As Object Implements Windows.Data.IValueConverter.Convert
            Dim _v As Visibility = value
            Select Case _v
                Case Visibility.Hidden
                    Return ScrollBarVisibility.Hidden
                Case Visibility.Collapsed
                    Return ScrollBarVisibility.Hidden
                Case Visibility.Visible
                    Return ScrollBarVisibility.Visible
                Case Else
                    Return ScrollBarVisibility.Hidden
            End Select
        End Function

        Public Function ConvertBack(value As Object _
                                  , targetType As Type _
                                  , parameter As Object _
                                  , culture As Globalization.CultureInfo) As Object Implements Windows.Data.IValueConverter.ConvertBack
            Return Nothing
        End Function
    End Class

End Namespace